package spring.cloud.tasks.executor.name_space.executor.task.task_listener;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.executor.common.Lifecycle;
import spring.cloud.tasks.executor.name_space.NameSpaceDataManager;
import spring.cloud.tasks.executor.name_space.TaskExecutorNodeCacheOrTreeCacheManager;
import spring.cloud.tasks.executor.name_space.executor.task.TaskExecutor;
import spring.cloud.tasks.executor.name_space.executor.task.task_listener.task_configuration.TaskConfiguration;

@Slf4j
@Setter
@Getter
public abstract class TaskListenerHolder implements Lifecycle {
    public NameSpaceDataManager nameSpaceDataManager;
    public String executorId;
    //
    public String taskId;
    public TaskConfiguration taskConfiguration;
    public TaskExecutor taskExecutor;
    public TaskExecutorNodeCacheOrTreeCacheManager taskExecutorNodeCacheOrTreeCacheManager;


    public TaskListenerHolder(final TaskExecutor taskExecutor) {
        this.nameSpaceDataManager = taskExecutor.getNameSpaceDataManager();
        this.executorId = taskExecutor.getExecutorId();
        this.taskId = taskExecutor.getTaskId();
        this.taskConfiguration = taskExecutor.getTaskConfiguration();
        this.taskExecutor = taskExecutor;
        this.taskExecutorNodeCacheOrTreeCacheManager = taskExecutor.getTaskExecutorNodeCacheOrTreeCacheManager();

    }

    public abstract void start();

    @Override
    public void stop() {
    }
}
